from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait


class BasePage():
    def __init__(self, driver: WebDriver = None):
        self.driver = driver

    def find(self, by, value):
        # self.driver.find_element(AppiumBy.XPATH, '')
        # allure.attach(body=self.driver.get_screenshot_as_png(), attachment_type=allure.attachment_type.PNG)
        WebDriverWait(self.driver, 10) \
            .until(expected_conditions.visibility_of_element_located(
            (by, value)
        ))
        return self.driver.find_element(by, value)
